package com.simoniu.connection.test;

import com.simoniu.util.DBUtil;

import java.sql.Connection;

public class ConnectionUtilDemo {

    public static void main(String[] args) {
        try {
            Connection conn1 = DBUtil.getConnection();
            Connection conn2 = DBUtil.getConnection();
            if(conn1!=null){
                System.out.println("数据库连接成功！");
            }else{
                System.out.println("数据库连接失败!");
            }
            System.out.println(conn1 == conn2); //true;
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
}
